<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>链接列表</title>
<link rel="icon" href="${pageContext.request.contextPath}/favicon.ico"  type="image/x-icon"/>
<link href="${pageContext.request.contextPath}/style/news.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js"></script>
<script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<div class="data_list backMain">
	<div class="dataHeader navi">
		当前位置：&nbsp;&nbsp;
		主页&nbsp;&nbsp;&gt;&nbsp;&nbsp;
		友情链接管理&nbsp;&nbsp;&gt;&nbsp;&nbsp;
		友情链接维护&nbsp;&nbsp;
	</div>
	<div class="data_content">
		<table class="table table-hover table-bordered">
			<tr>
				<th>序号</th>
				<th>链接名称</th>
				<th>链接地址</th>
				<th>排列顺序</th>
				<th>操作</th>
			</tr>
			<c:forEach items="${list}" var="link" varStatus="in">
				<tr>
					<td>${in.count}</td>
					<td>${link.linkName}</td>
					<td>${link.linkUrl}</td>
					<td>${link.orderNum}</td>
					<td>
						<button class="btn btn-mini btn-info" type="button" onclick="updateUI(${link.id})">修改</button>&nbsp;&nbsp;
						<button class="btn btn-mini btn-danger" type="button" onclick="del(${link.id})">删除</button>
						<script>
							function updateUI(id){
								location.href="${pageContext.request.contextPath}/link?method=updateUI&id="+id;
							}
							function del(id){
								if (confirm("你确定要删除吗？")){
									location.href="${pageContext.request.contextPath}/link?method=del&id="+id;
								}
							}
						</script>
					</td>
				</tr>
			</c:forEach>

		</table>
	</div>
</div>
</body>
</html>